<template>
  <rx-dialog @handOk="okFun" @cancel="cancelFun">
  <rx-layout>
    <div slot="center" style>
      <rx-grid
        ref="table"
        :bordered="isBorder"
        :allowRowSelect="true"
        :multiSelect="true"
        :columns="columns"
        :defaultPageSize="10"
        url="/api-portal/portal/core/insMsgDef/query"
        :queryParam="queryParam"
        data-field="result.data"
        :pageSizeOptions="['10','30','40']"
        id-field="msgId"
        @selectChange="onSelectChange"
      >
      </rx-grid>
    </div>
  </rx-layout>
  </rx-dialog>
</template>

<script>
import InsMsgDefApi from '@/api/portal/core/insMsgDef'
import InsMsgDefEdit from './InsMsgDefEdit'
import { BaseList, RxDialog, Util} from "@lowcode/jpaas-common-lib"
export default {
  name: 'InsMsgDefList',
  mixins: [BaseList],
  components: {
    RxDialog,
    Util
  },
  props: {
    single: {
      type: Boolean,
      default: true
    },
    layerid: {
      type: String,
      default: ""
    },
    destroy: {
      type: Function
    }
  },
  data() {
    return {
      columns: [
        { title: '#', dataIndex:'serial',type:'indexColumn',scopedSlots: { customRender: 'serial' }, width: 60 },
        { title: this.$ti18('rxList.title','标题'), width: 140,dataIndex: 'content' },
        { title: this.i18n('form.url','更多URL'), width: 140,dataIndex: 'url' },
        { title: this.i18n('form.type','类型'), width: 140,dataIndex: 'type',  }
      ],
      component: InsMsgDefEdit,
      comment: 'INS_MSG_DEF',
      widthHeight: ['1200px', '600px']
    }
  },
    created() {
        this.needFilterAppId();
    },

    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"InsMsgboxDef",key);
        },
        okFun(){
          Util.closeWindow(this,"ok");
        },
        cancelFun(){
          Util.closeWindow(this,"cancel");
        },
        getSelect(){
          var selectObj={
            single: this.single,
            data:this.selectedRows
          }
          return selectObj;
        },
        delById(ids) {
          return InsMsgDefApi.del({ ids: ids.join(',') })
        },
        getListByParams(parameter) {
          return InsMsgDefApi.query(parameter)
        }
    }
}
</script>
<style scoped>

</style>

